package com.sky.controller.user;


import com.sky.entity.Sign;
import com.sky.result.Result;
import com.sky.service.impl.SignServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "C端-签到的相关接口")
@Slf4j
@RequestMapping("/user/sign")
public class SignController {
    @Autowired
    private SignServiceImpl signService;
    /**
     * 获取签到数据
     * @return
     */
    @GetMapping
    @ApiOperation("获取签到数据")
    public Result<Sign> loadSignData(){
       Sign sign=signService.loadSignData();
       return Result.success(sign);
    }

    /**
     * 保存签到数据
     * @param sign
     * @return
     */
    @PostMapping
    @ApiOperation("保存签到数据")
    public Result savaSignData(@RequestBody Sign sign){
        signService.saveSignData(sign);
        return Result.success();
    }
}
